# -*- coding: utf-8 -*-

'''
    链式调用，与大模型无关，纯python学习
'''


class Pipe:
    def __init__(self, value):
        self.value = value

    def __or__(self, func):
        return Pipe(func(self.value))

def func1(x):
    return x + 1

def func2(x):
    return x * 2

def func3(x):
    return x - 3

data = 5
result = Pipe(data) | func1 | func2 | func3
print(result.value)  # 输出最终结果
